﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ControlStockJulioDomingo.Utilidades.Panel
{
   public static class Paneles
    {
       public static void LimpiarFormulario(System.Windows.Forms.Panel panel)
       {

           foreach (Control c in panel.Controls)
           {

               if (c is TextBox)
               {
                   c.Text = "";
               }
               if (c is ComboBox)
               {
                   ComboBox t = c as ComboBox;
                   t.SelectedIndex = 0;
               }

               if (c is CheckBox)
               {
                   ((CheckBox)c).Checked = false;
               }

               if (c is DataGrid)
               {

                   DataGrid dg = c as DataGrid;
                   dg.DataSource = null;

               }

           }


       }



    }
}
